package safe.yunchexing.com.cloudsafe.splash;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;


import safe.yunchexing.com.cloudsafe.R;
import safe.yunchexing.com.cloudsafe.login.LoginActivity;
import safe.yunchexing.com.cloudsafe.mvp.BaseActivity;

/**
 * Created by lixiaoming on 16/4/6.
 */
public class SplashActivity extends BaseActivity {

    Handler handler = new Handler();

    Runnable runnable = new Runnable() {
        @Override
        public void run() {
            Intent intent = new Intent(SplashActivity.this,LoginActivity.class);
            startActivity(intent);
            finish();
        }
    };
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);

        handler.postDelayed(runnable,2000);
    }

    @Override
    protected void onPause() {
        super.onPause();
        handler.removeCallbacks(runnable);
        finish();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }
}
